/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
}

/* 布局样式 */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* 头部导航栏 */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #1890ff;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.app-header .logo {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
}

.app-header .logo img {
    height: 30px;
    margin-right: 10px;
}

.app-header .user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* 侧边菜单 */
.app-sidebar {
    width: 220px;
    background-color: #fff;
    border-right: 1px solid #e8e8e8;
    height: 100vh;
    position: fixed;
    top: 50px;
    left: 0;
    overflow-y: auto;
    z-index: 900;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.menu-item {
    padding: 0;
}

.menu-title {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    color: #333;
    border-left: 3px solid transparent;
}

.menu-title:hover {
    background-color: #f0f0f0;
}

.menu-title.active {
    color: #1890ff;
    background-color: #e6f7ff;
    border-left-color: #1890ff;
}

.menu-icon {
    margin-right: 10px;
    font-size: 16px;
    width: 16px;
    text-align: center;
}

.menu-arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.menu-item.open .menu-arrow {
    transform: rotate(90deg);
}

.submenu {
    list-style: none;
    background-color: #fafafa;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-in-out;
}

.menu-item.open .submenu {
    max-height: 1000px;
}

.submenu-item {
    padding: 5px 16px 10px 20px;
    cursor: pointer;
    color: #666;
}

.submenu-item:hover {
    background-color: #f0f0f0;
    color: #1890ff;
}

.submenu-item.active {
    background-color: #e6f7ff;
    color: #1890ff;
}

/* 添加三级菜单相关样式 */
.submenu-title {
    display: flex;
    align-items: center;
    padding: 10px 16px 10px 30px;
    cursor: pointer;
    color: #666;
}

.submenu-title:hover {
    background-color: #f0f0f0;
    color: #1890ff;
}

.submenu-title.active {
    background-color: #e6f7ff;
    color: #1890ff;
}

.third-menu {
    list-style: none;
    background-color: #f0f0f0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-in-out;
}

.submenu-item[data-submenu].open .third-menu {
    max-height: 1000px;
}

.third-menu-item {
    padding: 8px 16px 8px 60px;
    cursor: pointer;
    color: #666;
}

.third-menu-item:hover {
    background-color: #e8e8e8;
    color: #1890ff;
}

.third-menu-item.active {
    background-color: #d9eeff;
    color: #1890ff;
}

/* 主内容区 */
.app-main {
    flex: 1;
    margin-left: 220px;
    margin-top: 50px;
    padding: 20px;
    overflow-y: auto;
}

/* 完善内容头部样式 */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.content-title {
    font-size: 20px;
    margin: 0;
    color: #333;
    font-weight: 600;
}

/* 改进表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
    font-size: 14px;
}

.data-table th, 
.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}

.data-table th {
    background-color: #fafafa;
    font-weight: 600;
    color: #666;
}

.data-table tr:hover {
    background-color: #f5f5f5;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table .table-actions {
    width: 150px;
    white-space: nowrap;
}

.data-table .table-actions a {
    margin-right: 10px;
    color: #1890ff;
    text-decoration: none;
}

.data-table .table-actions a:hover {
    color: #40a9ff;
    text-decoration: underline;
}

.data-table .table-actions .delete {
    color: #f5222d;
}

.data-table .table-actions .delete:hover {
    color: #ff4d4f;
}

/* 响应式表格处理 */
@media (max-width: 768px) {
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .content-actions {
        margin-top: 10px;
        align-self: flex-end;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-input {
        border-radius: 4px;
        border-right: 1px solid #d9d9d9;
        margin-bottom: 10px;
    }
    
    .search-btn {
        border-radius: 4px ;
        width: 100%;
    }
}

/* 加载中样式 */
.loading {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 16px;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #1890ff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 消息提示容器样式 */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.alert {
    margin-bottom: 10px;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-width: 400px;
    position: relative;
    animation: slideIn 0.3s;
}

.alert.fade-out {
    animation: fadeOut 0.5s;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 表单样式 */
.data-form {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-control[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #1890ff;
    color: white;
}

.btn-primary:hover {
    background-color: #40a9ff;
}

.btn-success {
    background-color: #52c41a;
    color: white;
}

.btn-success:hover {
    background-color: #73d13d;
}

.btn-danger {
    background-color: #f5222d;
    color: white;
}

.btn-danger:hover {
    background-color: #ff4d4f;
}

.btn-default {
    background-color: #fff;
    border: 1px solid #d9d9d9;
    color: #666;
}

.btn-default:hover {
    border-color: #1890ff;
    color: #1890ff;
}

/* 分页样式 */
.pagination {
    display: flex;
    list-style: none;
    margin-top: 20px;
    justify-content: center;
}

.pagination li {
    margin: 0 5px;
}

.pagination a {
    display: block;
    padding: 6px 12px;
    background-color: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    text-decoration: none;
}

.pagination a:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination .active a {
    background-color: #1890ff;
    border-color: #1890ff;
    color: white;
}

.pagination .disabled a {
    color: #d9d9d9;
    cursor: not-allowed;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.search-btn {
    padding: 8px 16px;
    background-color: #1890ff;
    color: black;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* 提示信息 */
.alert-success {
    background-color: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.alert-error {
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    color: #f5222d;
}

.alert-warn {
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    color: #faad14;
}

.alert-info {
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
}

/* 页签样式 */
.tabs {
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 20px;
}

.tab-nav {
    display: flex;
    list-style: none;
}

.tab-nav-item {
    margin-right: 20px;
    padding: 10px 0;
    cursor: pointer;
    position: relative;
}

.tab-nav-item.active {
    color: #1890ff;
}

.tab-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #1890ff;
}

/* 数据详情页面样式 */
.data-detail {
    background-color: #fff;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.detail-group {
    display: flex;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #f0f0f0;
}

.detail-group:last-child {
    border-bottom: none;
}

.detail-group label {
    width: 180px;
    font-weight: 600;
    color: #666;
    padding-right: 20px;
    text-align: right;
    flex-shrink: 0;
}

.detail-group div {
    flex: 1;
    word-break: break-word;
    line-height: 1.6;
}

.detail-group pre {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.detail-actions {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.detail-actions .btn {
    margin: 0 10px;
}

/* 打印样式 */
@media print {
    .app-header, .app-sidebar, .content-header, .detail-actions {
        display: none !important;
    }
    
    .app-main {
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    .data-detail {
        box-shadow: none;
        padding: 0;
    }
}

/* 响应式详情页面 */
@media (max-width: 768px) {
    .detail-group {
        flex-direction: column;
    }
    
    .detail-group label {
        width: 100%;
        text-align: left;
        padding-bottom: 5px;
    }
}

/* 头部操作按钮样式 */
.content-actions {
    display: flex;
    align-items: center;
}

.content-actions .btn {
    margin-left: 10px;
}

/* 数据详情页选项卡样式 */
.data-tabs {
    margin-bottom: 20px;
}

.tab-nav {
    display: flex;
    list-style: none;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 20px;
    padding-left: 0;
}

.tab-nav-item {
    margin-right: 24px;
    padding: 12px 0;
    cursor: pointer;
    font-weight: 500;
    position: relative;
    color: #666;
    transition: color 0.3s;
}

.tab-nav-item:hover {
    color: #1890ff;
}

.tab-nav-item.active {
    color: #1890ff;
}

.tab-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #1890ff;
}

.tab-content {
    margin-top: 20px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 详情页面内的pre标签样式 */
.detail-group pre {
    background-color: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e8e8e8;
}

.detail-group pre::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.detail-group pre::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.detail-group pre::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

/* 响应式选项卡 */
@media (max-width: 768px) {
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .tab-nav-item {
        margin-right: 15px;
        padding: 8px 0;
        font-size: 14px;
    }
}

